home *** CD-ROM | disk | FTP | other *** search
/ Star Festival... a Return to Japan / Star Festival... a Return to Japan.iso / pc / STARFESTIVAL / Opening.dir / 00026_text.txt < prev    next >
Encoding:
Text File  |  1999-09-21  |  4.3 KB  |  237 lines

  1. --
  2. -- Handles the screen output for single 
  3.     and single class choices.
  4. --
  5.  
  6. on initStudentNum
  7.   global studentNum, choiceFlag
  8.   
  9.   if choiceFlag = "ind,s,class" 
  10.     then set studentNum = 0
  11.   
  12. end initStudentNum
  13.  
  14. --
  15. on initRecords
  16.   global theGame, studentNum, currentTeacher, 
  17.     whichStudent, currentStudent
  18.   global gameString, programString, 
  19.     currentClassRecord, choiceFlag, gameName
  20.   
  21.   if item 1 of choiceFlag = "ind" and item 3 of 
  22.     choiceFlag = "class" then
  23.     set studentNum = studentNum + 1
  24.     if studentNum > (the number of lines in 
  25.     currentClassRecord) then
  26.       exitRecords
  27.       exit
  28.     end if
  29.     set whichStudent = item 1 of line 
  30.     studentNum of currentClassRecord
  31.   else
  32.     set whichStudent = currentStudent
  33.   end if
  34.   
  35.   set theGame = 1
  36.   set whichGame = 
  37.     line theGame of gameString
  38.   set gameName = 
  39.     line theGame of programString
  40.   set theRecord = 
  41.     formatRecord( whichGame, gameName )
  42.   
  43.   set the text of field "currentTeacher" to 
  44.     ("Student:" && whichStudent & "   
  45.      Teacher:" && currentTeacher)
  46.   
  47.   puppetSprite 12, true
  48.   if gameName = "Sort bdp" then
  49.     set the locH of sprite 12 to 409
  50.   else
  51.     set the locH of sprite 12 to 1000
  52.   end if
  53.   puppetSprite 12, false
  54.   
  55.   
  56.   setRecordText theRecord
  57.   
  58.   cursor 128
  59.   updateStage
  60.   
  61. end initRecords
  62.  
  63. --
  64.  
  65. on nextRecord
  66.   global theGame, theLine, gameString,
  67.      programString, choiceFlag
  68.   global theFlush, gameName
  69.   
  70.   set the castNum of sprite 17 =
  71.     (the number of cast "nextScr.blank")
  72.   set the castNum of sprite 18 =
  73.      (the number of cast "lastScr.blank")
  74.   updateStage
  75.   
  76.   set theGame = theGame + 1
  77.   if theGame > (the number of 
  78.     lines in gameString) then
  79.     if choiceFlag = "ind,s,class"
  80.      then initRecords
  81.     else exitRecords
  82.     exit
  83.   end if
  84.   
  85.   set whichGame = line theGame 
  86.        of gameString
  87.   set gameName = line theGame of
  88.      programString
  89.   set theRecord = formatRecord
  90.     (whichGame,gameName)
  91.   
  92.     
  93.   puppetSprite 12, true
  94.   if "Sort bdp, Bridge, Balloons" 
  95.     contains gameName then
  96.     set the locH of sprite 12 to 409
  97.   else
  98.     set the locH of sprite 12 to 1000
  99.   end if
  100.   puppetSprite 12, false
  101.   
  102.   setRecordText theRecord
  103.   
  104.   theFlush(mFlush)
  105.   
  106. end nextRecord
  107.  
  108. --
  109.  
  110. on exitRecords
  111.   global currentTeacher, 
  112.     choiceFlag, theFlush
  113.   
  114.   allSpritesOff
  115.   
  116.   if choiceFlag = "ind,s,single" 
  117.     then go "Single"
  118.   else go "Reports"
  119.   
  120.   set the text of field "currentTeacher" 
  121.     to currentTeacher
  122.   
  123.   theFlush(mFlush)
  124.   
  125. end exitRecords
  126.  
  127. --
  128.  
  129. on exitClassRecords
  130.   global currentTeacher
  131.   
  132.   allSpritesOff
  133.   
  134.   go "Reports"
  135.   set the text of field "currentTeacher" 
  136.     to currentTeacher
  137.   
  138. end exitClassRecords
  139.  
  140. --
  141.  
  142. on formatRecord whichGame, gameName
  143.   global incUnit, whichStudent, 
  144.     currentTeacher, thePath, Record,
  145.      programString, theGame
  146.   
  147.   set target = whichGame & ":" & currentTeacher
  148.      & ":" & whichStudent
  149.   set incUnit = FileIO(mNew, "read", 
  150.     thePath & "Records:Scores:" & target)
  151.   
  152.   if not objectP(incUnit) then
  153.     set theProblem = string( incUnit )
  154.     if theProblem = "-43" then
  155.       set theRecord = 
  156.     ("No data exists for" && gameName)
  157.       return theRecord
  158.       exit
  159.     else
  160.       put alert string
  161.     ("error type" && theProblem)
  162.     end if
  163.   end if
  164.   
  165.   set theRecord = incUnit(mReadFile)
  166.   incUnit(mDispose)
  167.   
  168.   set fRecord = ""
  169.   set sP = " "
  170.   repeat with i = 1 to 
  171.     (the number of lines in theRecord)
  172.     
  173.     set incString = line i of theRecord
  174.     
  175.     if item 4 of incString = "-" then 
  176.     set timeChar = " "
  177.     else set timeChar = item 4 of incString
  178.     
  179.     if item 5 of incString = "-" 
  180.     then set helpChar = " "
  181.     else set helpChar = item 5 of incString
  182.     
  183.     set recString = item 1 of incString & chars
  184.     (sP,1,3) & item 2 of incString & chars(sP,1,3)√Ç
  185.     & item 3 of incString & chars(sP,1,5) 
  186.     & timeChar & chars(sP,1,12)√Ç
  187.     & helpChar & RETURN
  188.     
  189.     set fRecord = fRecord & recString
  190.     
  191.   end repeat
  192.   
  193.   set fRecord = chars
  194.     (fRecord,1,length(fRecord) - 1)
  195.   set fRecord = (line theGame of programString 
  196.     & RETURN & RETURN & fRecord)
  197.   
  198.   return fRecord
  199.   
  200. end formatRecord 
  201.  
  202. -- RESET
  203. -- RESET
  204. -- RESET
  205. -- RESET
  206. -- RESET
  207. -- RESET
  208. -- RESET
  209. -- RESET
  210. -- RESET
  211. -- RESET
  212. -- RESET
  213. -- RESET
  214. -- RESET
  215. -- RESET
  216. -- RESET
  217. -- RESET
  218. -- RESET
  219. -- RESET
  220. -- RESET
  221. -- RESET
  222. -- RESET
  223. -- RESET
  224. -- RESET
  225. -- RESET
  226. -- RESET
  227. -- RESET
  228. -- RESET
  229. -- RESET
  230. -- RESET
  231. -- RESET
  232. -- RESET
  233. -- RESET
  234. -- RESET
  235.  
  236.  
  237.